/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-10-10
 * Time: 14:23
 */
//统计1-100的所有整数中出现多少次数字9
public class TestDemo {
    public static void main(String[] args) {
        int count = 0;
        for (int i = 1; i <= 100; i++) {
            if (i % 10 == 9) {
                count++;
                System.out.print(i + " ");
            }if (i / 10 == 9) {
                count++;
                System.out.print(i + " ");
            }
        }
        System.out.println("共有" + count + "个");
    }
}
